From: kaf24@firebug.cl.cam.ac.uk Date: Wed, 10 May 2006 16:30:42 +0000 (+0100) Subject: When we copy packet sin netback/netfront make sure the new skb has X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16047^2~90 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=8e5846fe5bae9f62497f4802986db5e68dc68eb4;p=xen.git When we copy packet sin netback/netfront make sure the new skb has all the necessary fields initialised. In particular, before we were not copying ip_summed and that screws up checksum offload. Signed-off-by: Keir Fraser --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c index 60628ea9b4..65432c8958 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c @@ -170,9 +170,10 @@ int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev) ret = skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen); BUG_ON(ret); + /* Copy only the header fields we use in this driver. */ nskb->dev = skb->dev; + nskb->ip_summed = skb->ip_summed; nskb->proto_data_valid = skb->proto_data_valid; - nskb->proto_csum_blank = skb->proto_csum_blank; dev_kfree_skb(skb); skb = nskb; } diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 197e34c47a..99e0a5f607 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -665,7 +665,10 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev) goto drop; skb_put(nskb, skb->len); memcpy(nskb->data, skb->data, skb->len); + /* Copy only the header fields we use in this driver. */ nskb->dev = skb->dev; + nskb->ip_summed = skb->ip_summed; + nskb->proto_data_valid = skb->proto_data_valid; dev_kfree_skb(skb); skb = nskb; } @@ -898,8 +901,11 @@ static int netif_poll(struct net_device *dev, int *pbudget) skb_reserve(nskb, 2); skb_put(nskb, skb->len); memcpy(nskb->data, skb->data, skb->len); + /* Copy any other fields we already set up. */ nskb->dev = skb->dev; nskb->ip_summed = skb->ip_summed; + nskb->proto_data_valid = skb->proto_data_valid; + nskb->proto_csum_blank = skb->proto_csum_blank; } /* Reinitialise and then destroy the old skbuff. */